package io.dbw.common.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * @author lxc
 * @description:
 * @date 2021/1/11 14:06
 */
@Component
@Order(1)
public class CommParamUtils implements Serializable{
    public static final long serialVersionUID = 1L;

    /**
     * 上传路径
     */
    public static String filePath;
    //微信相关参数
    public static  String appId;

    public static  String appSecret;
    /**
     * 阿里短信参数
     */
    public static  String accessKeyId;
    public static  String accessKeySecret;
    public static  String endpoint;
    public static  String singName;
    public static  String templateCodeOne;
    public static  String templateCodeTwo;
    public static  Integer sendMaxNum;

    /**
     * 腾讯云区块链参数
     */
    public static  String btoeSecretId;
    public static  String btoeSecretKey;
    public static  String btoeEndpoint;
    public static  String btoeRegion;

    /**
     * 快递100-授权key
     */
    public static String expressKey ;

    public static String expressCustomer ;

    public static Boolean taskSwitch ;

    public static Boolean getTaskSwitch() {
        return taskSwitch;
    }

    @Value("${scheduling.enabled}")
    public void setTaskSwitch(Boolean taskSwitch) {
        CommParamUtils.taskSwitch = taskSwitch;
    }

    public static String getBtoeSecretId() {
        return btoeSecretId;
    }

    @Value("${tencent.btoeSecretId}")
    public void setBtoeSecretId(String btoeSecretId) {
        CommParamUtils.btoeSecretId = btoeSecretId;
    }

    public static String getBtoeSecretKey() {
        return btoeSecretKey;
    }

    @Value("${tencent.btoeSecretKey}")
    public void setBtoeSecretKey(String btoeSecretKey) {
        CommParamUtils.btoeSecretKey = btoeSecretKey;
    }

    public static String getBtoeEndpoint() {
        return btoeEndpoint;
    }

    @Value("${tencent.btoeEndpoint}")
    public void setBtoeEndpoint(String btoeEndpoint) {
        CommParamUtils.btoeEndpoint = btoeEndpoint;
    }

    public static String getBtoeRegion() {
        return btoeRegion;
    }

    @Value("${tencent.btoeRegion}")
    public void setBtoeRegion(String btoeRegion) {
        CommParamUtils.btoeRegion = btoeRegion;
    }

    public static String getAccessKeyId() {
        return accessKeyId;
    }
    @Value("${aliyun.accessKeyId}")
    public void setAccessKeyId(String accessKeyId) {
        CommParamUtils.accessKeyId = accessKeyId;
    }

    public static String getAccessKeySecret() {
        return accessKeySecret;
    }
    @Value("${aliyun.accessKeySecret}")
    public void setAccessKeySecret(String accessKeySecret) {
        CommParamUtils.accessKeySecret = accessKeySecret;
    }

    public static String getEndpoint() {
        return endpoint;
    }
    @Value("${aliyun.endpoint}")
    public void setEndpoint(String endpoint) {
        CommParamUtils.endpoint = endpoint;
    }

    public static String getSingName() {
        return singName;
    }
    @Value("${aliyun.singName}")
    public void setSingName(String singName) {
        CommParamUtils.singName = singName;
    }

    public static String getTemplateCodeOne() {
        return templateCodeOne;
    }
    @Value("${aliyun.templateCodeOne}")
    public void setTemplateCodeOne(String templateCodeOne) {
        CommParamUtils.templateCodeOne = templateCodeOne;
    }

    public static String getTemplateCodeTwo() {
        return templateCodeTwo;
    }
    @Value("${aliyun.templateCodeTwo}")
    public void setTemplateCodeTwo(String templateCodeTwo) {
        CommParamUtils.templateCodeTwo = templateCodeTwo;
    }

    public static Integer getSendMaxNum() {
        return sendMaxNum;
    }
    @Value("${aliyun.sendMaxNum}")
    public void setSendMaxNum(Integer sendMaxNum) {
        CommParamUtils.sendMaxNum = sendMaxNum;
    }

    @Value("${auth.wechat.appId}")
    public void setAppId(String appId) {
        CommParamUtils.appId = appId;
    }

    @Value("${auth.wechat.secret}")
    public void setAppSecret(String appSecret) {
        CommParamUtils.appSecret = appSecret;
    }

    @Value("${common.filePath}")
    public void setFilePath(String filePath) {
        CommParamUtils.filePath = filePath;
    }

    @Value("${common.express.key}")
    public void setExpressKey(String expressKey) {
        CommParamUtils.expressKey = expressKey;
    }

    @Value("${common.express.customer}")
    public void setExpressCustomer(String expressCustomer) {
        CommParamUtils.expressCustomer = expressCustomer;
    }

    public static String getUpLoadPath() {
        return CommParamUtils.filePath + "upload/";
    }

    public static String getDownloadPath() {
        return CommParamUtils.filePath + "download/";
    }

    public static String getTemplatePath() {
        return CommParamUtils.filePath + "template/";
    }
}
